package Factory;

public class AppleFactory  extends FruitFactory {
    public  final  static String BIGAPPlE="apple";
    public  final  static String SMALLAPPLE="pear";

    Fruit createFruit(String type)
    {
        switch (type)
        {
            case BIGAPPlE:
                return new BigApple();
            case SMALLAPPLE:
                return new SmallApple();
            default:
                //不需要break了？？？？
                throw new IllegalArgumentException("暂时没有这种水果");
        }
    }
}
